home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / interfaces / graphics libraries.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-30  |  20.8 KB  |  454 lines  |  [TEXT/MPS ]

  1. /* graphics libraries:
  2.     general library interfaces
  3.     by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Josh Horwich, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  4.     Copyright 1987 - 1993 Apple Computer, Inc.  All rights reserved.    */
  5.  
  6. #pragma once
  7. #ifndef graphicsLibrariesIncludes
  8.     #define graphicsLibrariesIncludes
  9.  
  10.     #ifndef graphicsRoutinesIncludes
  11.         #include "graphics routines.h"
  12.     #endif
  13.     #ifndef mathRoutinesIncludes
  14.         #include "math routines.h"
  15.     #endif
  16.  
  17.     #ifdef __cplusplus
  18.     extern "C" {
  19.     #endif
  20.  
  21.     /*    We use “if( a ) b; else” instead of “{ if (a ) b; }” because the first one can be used in an if-else
  22.         statement and the second one can’t (due to the “;” at the end of the macro instance. */
  23.  
  24.     #define NilShapeReturn(a)            if ((a) == (gxShape) nil) {GXPostGraphicsError(shape_is_nil); return; } else
  25.     #define NilShapeReturnNil(a)        if ((a) == (gxShape) nil) {GXPostGraphicsError(shape_is_nil); return 0L; } else
  26.     #define NilStyleReturn(a)            if ((a) == (gxStyle) nil) {GXPostGraphicsError(style_is_nil); return; } else
  27.     #define NilStyleReturnNil(a)        if ((a) == (gxStyle) nil) {GXPostGraphicsError(style_is_nil); return 0L; } else
  28.     #define NilInkReturn(a)            if ((a) == (gxInk) nil) {GXPostGraphicsError(ink_is_nil); return; } else
  29.     #define NilInkReturnNil(a)            if ((a) == (gxInk) nil) {GXPostGraphicsError(ink_is_nil); return 0L; } else
  30.     #define NilTransformReturn(a)        if ((a) == (gxTransform) nil) {GXPostGraphicsError(transform_is_nil); return; } else
  31.     #define NilTransformReturnNil(a)    if ((a) == (gxTransform) nil) {GXPostGraphicsError(transform_is_nil); return 0L; } else
  32.     #define NilColorSetReturn(a)        if ((a) == (gxColorSet) nil) {GXPostGraphicsError(colorSet_is_nil); return; } else
  33.     #define NilColorSetReturnNil(a)        if ((a) == (gxColorSet) nil) {GXPostGraphicsError(colorSet_is_nil); return 0L; } else
  34.     #define NilColorProfileReturn(a)    if ((a) == (gxColorProfile) nil) {GXPostGraphicsError(colorProfile_is_nil); return; } else
  35.     #define NilColorProfileReturnNil(a)    if ((a) == (gxColorProfile) nil) {GXPostGraphicsError(colorProfile_is_nil); return 0L; } else
  36.     #define NilTagReturn(a)            if ((a) == (gxTag) nil) {GXPostGraphicsError(tag_is_nil); return; } else
  37.     #define NilTagReturnNil(a)        if ((a) == (gxTag) nil) {GXPostGraphicsError(tag_is_nil); return 0L; } else
  38.  
  39.     #ifdef debugging
  40.         /* just in case the application (or the graphics system) redefined these to something weird... */
  41.         #undef DebugStr
  42.         #undef IfDebug
  43.  
  44.         #define IfDebug(a, b)                if (a) DebugStr(b); else
  45.         #define IfDebugReturn(a, b)        if (a) { DebugStr(b); return; } else
  46.         #define IfDebugReturnNil(a, b)        if (a) { DebugStr(b); return 0L; } else
  47.         #define NilParamReturn(a)        if ((a) == 0L) {GXPostGraphicsError(parameter_is_nil); return; } else
  48.         #define NilParamReturnNil(a)        if ((a) == 0L) {GXPostGraphicsError(parameter_is_nil); return 0L; } else
  49.         #define IfErrorReturn(a,b)        if (a) { GXPostGraphicsError(b); return; } else
  50.         #define IfErrorReturnNil(a,b)        if (a) { GXPostGraphicsError(b); return 0L; } else
  51.         #define IfNotice(a, b)            if (a) GXPostGraphicsNotice(b); else
  52.         #define IfWarning(a,b)            if (a) GXPostGraphicsWarning(b); else
  53.         #define IfWarningReturn(a,b)        if (a) { GXPostGraphicsWarning(b); return; } else
  54.         #define IfWarningReturnNil(a,b)    if (a) { GXPostGraphicsWarning(b); return 0L; } else
  55.     #else
  56.         #define IfDebug(a, b)
  57.         #define IfDebugReturn(a, b)
  58.         #define IfDebugReturnNil(a, b)
  59.         #define NilParamReturn(a)
  60.         #define NilParamReturnNil(a)
  61.         #define IfErrorReturn(a,b)
  62.         #define IfErrorReturnNil(a,b)
  63.         #define IfNotice(a, b)
  64.         #define IfWarning(a,b)
  65.         #define IfWarningReturn(a,b)        if (a) return; else
  66.         #define IfWarningReturnNil(a,b) if (a) return 0L; else
  67.     #endif
  68.  
  69.  
  70.     enum commonColors {
  71.         /* common color names */
  72.         gxWhite = 1,        gxBlack,                gxGray,                gxGrey = gxGray,
  73.     #ifndef __QUICKDRAW__
  74.         white = 1,            black,                gray,                grey = gray,
  75.     #endif
  76.             /* primaries */
  77.         red,                green,                blue,
  78.             /* secondaries */
  79.         cyan,            magenta,                yellow,
  80.             /* tertiaries */
  81.         orange,            chartreuse,            aqua,                teal = aqua,
  82.         slate,            purple,                violet = purple,            maroon,
  83.             /* others */
  84.         brown,            pink,                    turquoise,
  85.         cadmium_lemon,    cadmium_light_yellow,    aureoline_yellow,        naples_deep_yellow,
  86.         cadmium_yellow,     cadmium_deep_yellow,    cadmium_orange,        cadmium_light_red,
  87.         cadmium_deep_red,    geranium_lake,            alizarin_crimson,        rose_madder,
  88.         madder_deep_lake,    brown_madder,            permanent_red_violet,    cobalt_deep_violet,
  89.         ultramarine_violet,    ultramarine_blue,        cobalt_blue,            royal_blue,
  90.         cerulean_blue,        manganese_blue,        indigo,                turquoise_blue,
  91.         emerald_green,        permanent_green,        viridian_light,            cobalt_green,
  92.         cinnabar_green,     sap_green,            chromium_oxide_green,    terre_verte,
  93.         yellow_ochre,        mars_yellow,            raw_sienna,            mars_orange,
  94.         gold_ochre,        brown_ochre,            deep_ochre,            burnt_umber,
  95.         burnt_sienna,        flesh,                flesh_ochre,            english_red,
  96.         venetian_red,        indian_red,            raw_umber,            greenish_umber,
  97.         van_dyck_brown,    sepia,                warm_grey,            cold_grey,
  98.         ivory_black,        lamp_black,            titanium_white,        zinc_white,
  99.         pale_gold,            gold,                    old_gold,                pink_gold,
  100.         white_gold,        yellow_gold,            green_gold,            platinum,
  101.         silver,            antique_silver,            chrome,                steel,
  102.         copper,            antique_copper,        oxidized_copper,        bronze,
  103.         brass,            iron,                    rusted_iron,            lead,
  104.         fluorescent_pink,    fluorescent_green,        fluorescent_blue,
  105.         incadescent_high,    incadescent_low,
  106.         moonlight,            sodium,                daylight,                dawn,
  107.         afternoon,            dusk,
  108.         mauve,
  109.         apple_green,        apple_yellow,            apple_orange,            apple_red,
  110.         apple_purple,        apple_blue,
  111.  
  112.         /* common color modifiers */
  113.         light = 512,
  114.         dark = 1024,
  115.         warm = 2048,
  116.         reddish = warm,
  117.         cool = 4096,
  118.         bluish = cool,
  119.         grayish = 8192,
  120.         whitish = light,
  121.         blackish = dark,
  122.         greenish = 16384
  123.     };
  124.  
  125.     typedef long commonColor;
  126.  
  127.     extern gxColorSet commonColorSet;
  128.     extern gxSetColor commonColorList[];
  129.     extern short commonColorCount;
  130.  
  131. /* some very useful constructive definitions for creating colors */
  132. /* see 'color library.c' for an example of their use... */
  133.  
  134.     #define makeRGBSHORT(a,b,c) ((c >> 14) + ((b >> 13) + (a >> 13) << 3) << 3)
  135.     #define makeCMYKSHORT(a,b,c,d) ((d >> 14) + ((c >> 14) + ((b >> 14) + (a >> 14) << 2) << 2) << 2)
  136.     #define makeRGB16(a,b,c) ((c >> 11) + ((b >> 11) + (a >> 11) << 5) << 5)
  137.     #define makeCMYK16(a,b,c,d) ((d >> 12) + ((c >> 12) + ((b >> 12) + (a >> 12) << 4) << 4) << 4)
  138.     #define xRGB256(a,b,c) {gxRGBSpace,nil,{(a << 8)+a,(b << 8)+b,(c << 8)+c, 0 }}
  139.  
  140.     #define xRGB(a,b,c)    {gxRGBSpace,nil,{a,b,c,0}}
  141.     #define xCMYK(a,b,c,d) {gxCMYKSpace,nil,{a,b,c,d}}
  142.     #define xHSV(a,b,c) {gxHSVSpace,nil,{a,b,c,0}}
  143.     #define xCIE(a,b,c) {gxCIESpace,nil,{a,b,c,0}}
  144.     #define xYIQ(a,b,c) {gxYIQSpace,nil,{a,b,c,0}}
  145.     #define xXYZ(a,b,c) {gxXYZSpace,nil,{a,b,c,0}}
  146.     #define xLUV(a,b,c) {gxLUVSpace,nil,{a,b,c,0}}
  147.     #define xLAB(a,b,c) {gxLABSpace,nil,{a,b,c,0}}
  148.     #define xHLS(a,b,c) {gxHLSSpace,nil,{a,b,c,0}}
  149.     #define xNTSC(a,b,c) {gxNTSCSpace,nil,{a,b,c,0}}
  150.     #define xPAL(a,b,c) {gxPALSpace,nil,{a,b,c,0}}
  151.     #define xGRAY(a) {gxGraySpace,nil,{a,0,0,0}}
  152.     #define xRGB16(a,b,c) {gxRGB16Space,nil,{makeRGB16(a,b,c),0,0,0}}
  153.     #define xRGB32(a,b,c) {gxRGB32Space,nil,{(a >> 8),((c >> 8) + (b >> 8) << 8),0,0}}
  154.     #define xCMYK32(a,b,c,d) {gxCMYK32Space,nil,{((b >> 8) + (a >> 8) << 8),((d >> 8) + (c >> 8) << 8),0,0}}
  155.  
  156.     #define sRGB(r,g,b) {r,g,b,0}
  157.     #define sCMYK(c,m,y,k) {c,m,y,k}
  158.     #define sRGB256(a,b,c) {(a << 8)+a,(b << 8)+b,(c << 8)+c, 0 }
  159.  
  160.     enum commonFaces {
  161.         gxPlain,
  162.         gxBold = 1,
  163.         gxItalic = 2,
  164.         gxUnderline = 4,
  165.         gxOutline = 8,
  166.         gxShadow = 0x10,
  167.         gxCondense = 0x20,
  168.         gxExtend = 0x40,
  169.         gxLighten = 0x80
  170.     };
  171.  
  172.     typedef char commonFace;
  173.  
  174.     enum commonTransferModes {        /* These modes simulate QuickDraw's transfer modes    */
  175.         commonAddOverMode = 2000,
  176.         commonSubtractOverMode,
  177.         commonSubtractPinMode,
  178.         commonTransparentMode,
  179.         commonInMode,
  180.         commonOutMode
  181.     } ;
  182.  
  183.     typedef short commonTransferMode;
  184.  
  185.     struct cubic {
  186.         gxPoint a;
  187.         gxPoint b;
  188.         gxPoint c;
  189.         gxPoint d;
  190.     } ;
  191.     
  192.     struct conic {
  193.         gxPoint a;
  194.         gxPoint b;
  195.         gxPoint c;
  196.         Fixed lambda;
  197.     };
  198.  
  199. #ifndef __cplusplus
  200.     typedef struct cubic cubic;
  201.     typedef struct conic conic;
  202. #endif
  203.  
  204.     /* shape library */
  205.     gxShape NewPath(const gxPath *path);
  206.     gxShape NewPolygon(const gxPolygon *polygon);
  207.     gxPolygon *GetPolygon(gxShape source, long contour, gxPolygon *polygon);
  208.     gxPath *GetPath(gxShape source, long contour, gxPath *path);
  209.     void SetPath(gxShape target, long contour, const gxPath *path);
  210.     void SetPolygon(gxShape target, long contour, const gxPolygon *polygon);
  211.     void DrawPolygon(const gxPolygon *polygon, gxShapeFill fill);
  212.     void DrawPath(const gxPath *path, gxShapeFill fill);
  213.  
  214.     void SetShapeIndexPoint(gxShape target, long index, const gxPoint *point);
  215.     void SetShapeIndexControl(gxShape target, long index, long control);
  216.     gxPoint *GetShapeIndexPoint(gxShape source, long index, gxPoint *point);
  217.     long GetShapeIndexControl(gxShape source, long index, long *control);
  218.  
  219.     void InsertShape(gxShape target, long index, gxShape toAdd);
  220.     gxShape ExtractShape(gxShape source, long firstPoint, long numPoints);
  221.     void AddToShape(gxShape target, gxShape add);
  222.     void ExtendShape(gxShape target, gxShape add);
  223.  
  224.     #ifdef debugging
  225.         gxShape NewShape2(gxShapeType type, Fixed x, Fixed y);
  226.         gxShape NewShape4(gxShapeType type, Fixed firstX, Fixed firstY, Fixed lastX, Fixed lastY);
  227.         gxShape NewShape6(gxShapeType type, Fixed firstX, Fixed firstY, Fixed controlX, Fixed controlY, Fixed lastX, Fixed lastY);
  228.  
  229.         void SetShape2(gxShape target, Fixed x, Fixed y);
  230.         void SetShape4(gxShape target, Fixed firstX, Fixed firstY, Fixed lastX, Fixed lastY);
  231.         void SetShape6(gxShape target, Fixed firstX, Fixed firstY, Fixed controlX, Fixed controlY, Fixed lastX, Fixed lastY);
  232.     #else
  233.         #define NewShape2(type,p1,p2)                NewShapeMany(type, (Fixed)p1, (Fixed)p2)
  234.         #define NewShape4(type,p1,p2, p3, p4)            NewShapeMany(type, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4)
  235.         #define NewShape6(type,p1,p2, p3, p4, p5, p6)    NewShapeMany(type, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4, (Fixed)p5, (Fixed)p6)
  236.  
  237.         #define SetShape2(source,p1,p2)                SetShapeMany(source, (Fixed)p1, (Fixed)p2)
  238.         #define SetShape4(source,p1,p2, p3, p4)            SetShapeMany(source, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4)
  239.         #define SetShape6(source,p1,p2, p3, p4, p5, p6)    SetShapeMany(source, (Fixed)p1, (Fixed)p2, (Fixed)p3, (Fixed)p4, (Fixed)p5, (Fixed)p6)
  240.     #endif
  241.  
  242.     gxShape NewShapeMany(gxShapeType type, Fixed firstArg, ...);
  243.     void SetShapeMany(gxShape target, Fixed firstArg, ...);
  244.  
  245.     gxShape GetBitmapPartsFromFixedBounds(gxShape source, const gxRectangle *bounds);
  246.     void SetBitmapPartsFromFixedBounds(gxShape target, const gxRectangle *bounds, gxShape bitmapShape);
  247.  
  248.     /* arc library, oval library, roundrect library, cubic library, and conic library */
  249.     gxShape NewArc(const gxRectangle *rect, Fixed startAng, Fixed sweep, boolean wedge);
  250.     gxShape NewOval(const gxRectangle *rect);
  251.     gxShape NewRoundRect(const gxRectangle *rect, const gxPoint *ovalSize);
  252.     gxShape NewCubic(const cubic *curve);
  253.     gxShape NewConic(const conic *curve);
  254.  
  255.     void DrawArc(const gxRectangle *rect, Fixed startAng, Fixed sweep, boolean wedge);
  256.     void DrawOval(const gxRectangle *rect, gxShapeFill fill);
  257.     void DrawRoundRect(const gxRectangle *rect, const gxPoint *ovalSize, gxShapeFill fill);
  258.     void DrawCubic(const cubic *curve, gxShapeFill fill);
  259.     void DrawConic(const conic *curve, gxShapeFill fill);
  260.  
  261.     void SetArc(gxShape target, const gxRectangle *rect, Fixed startAng, Fixed sweep, boolean wedge);
  262.     void SetOval(gxShape target, const gxRectangle *rect);
  263.     void SetRoundRect(gxShape target, const gxRectangle *rect, const gxPoint *ovalSize);
  264.     void SetCubic(gxShape target, const cubic *curve);
  265.     void SetConic(gxShape target, const conic *curve);
  266.     
  267.     /* graphics debug library */
  268.     void SetGraphicsLibraryErrors(void);    /* set the error and warning routines */
  269.     void SetGraphicsLibraryNotices(void);    /* set the notice routine */
  270.     char *GraphicsErrorMessage(gxGraphicsError error);
  271.     char *GraphicsWarningMessage(gxGraphicsWarning warning);
  272.     char *GraphicsNoticeMessage(gxGraphicsNotice notice);
  273.     void DisplayGraphicsErrorMessage(gxGraphicsError error, long reference);
  274.     void DisplayGraphicsWarningMessage(gxGraphicsWarning warning, long reference);
  275.     void DisplayGraphicsNoticeMessage(gxGraphicsNotice notice, long reference);
  276.  
  277.     /* gxShape library */
  278.     void CenterShape(gxShape target, gxRectangle *rect);
  279.     void MoveShapeCenterTo(gxShape target, Fixed x, Fixed y);
  280.     void RotateShapeAboutCenter(gxShape target, Fixed degrees);
  281.     void SkewShapeAboutCenter(gxShape target, Fixed xSkew, Fixed ySkew);
  282.     void ScaleShapeAboutCenter(gxShape target, Fixed hScale, Fixed vScale);
  283.  
  284.     /* graphics library */
  285.     void MapShapeToSpace(gxShape target, gxViewPort port, gxViewDevice device);
  286.     void MapShapeFromSpace(gxShape target, gxViewPort port, gxViewDevice device);
  287.     void MapPointToSpace(gxPoint *target, gxViewPort port, gxViewDevice device);
  288.     void MapPointFromSpace(gxPoint *target, gxViewPort port, gxViewDevice device);
  289.  
  290.     /* gxTransform library */
  291.     gxViewPort GetTransformViewPort(gxTransform source);
  292.     void SetTransformViewPort(gxTransform target, gxViewPort port);
  293.     void AddToTransformViewPort(gxTransform target, gxViewPort port);
  294.     void SetShapeViewPort(gxShape target, gxViewPort port);
  295.     gxViewPort GetShapeViewPort(gxShape source);
  296.     void SetDeepShapeViewPort(gxShape target, gxViewPort port);
  297.     void SetDeepShapeViewPorts(gxShape target, long count, const gxViewPort portList[]);
  298.     void SetDeepShapeTransform(gxShape target, gxTransform);
  299.     void SetDefaultViewPort(gxViewPort port);
  300.     gxViewGroup CopyViewGroup(gxViewGroup group);
  301.     gxTransform ChangeTransformViewGroup(gxTransform target, gxViewGroup oldGroup, gxViewGroup newGroup);
  302.     gxShape ChangeShapeViewGroup(gxShape source, gxViewGroup oldGroup, gxViewGroup newGroup);
  303.     gxTransform SeparateShapeTransform(gxShape source);
  304.     void ReuniteShapeTransform(gxShape target, gxTransform separate);
  305.  
  306.     /* graphics state library */
  307.     gxStyle SeparateShapeStyle(gxShape source);
  308.     void ReuniteShapeStyle(gxShape target, gxStyle separate);
  309.     gxInk SeparateShapeInk(gxShape source);
  310.     void ReuniteShapeInk(gxShape target, gxInk separate);
  311.  
  312.     /* gxShape library */
  313.     void GetPathsIndexPointControl(const gxPaths *source, long index, gxPoint **pt, long **controlPtr, long *controlMask);
  314.     void SetShapeOpenPath(gxShape target);
  315.     void PreMapTransform(gxTransform source, gxMapping *map);
  316.  
  317.     /* graphics library */
  318.     #define CopyShape(s) GXCopyToShape(nil,s)
  319.     #define CopyStyle(s) GXCopyToStyle(nil,s)
  320.     #define CopyInk(s) GXCopyToInk(nil,s)
  321.     #define CopyTransform(s) GXCopyToTransform(nil,s)
  322.     void DisposeTransformAt(gxTransform *target);
  323.     void DisposeShapeAt(gxShape *target);
  324.     void DisposeStyleAt(gxStyle *target);
  325.     void DisposeInkAt(gxInk *target);
  326.     void DisposeTagAt(gxTag *target);
  327.  
  328.     /* gxColor matching library */
  329.     gxColorProfile CreateQMSColorProfile(void);
  330.     gxColorProfile CreateCanonColorProfile(void);
  331.     gxColorProfile CreateColorSyncSystemProfile(void);
  332.  
  333.     /* gxColor library */
  334.     void InitCommonColors(void);
  335.     void DisposeCommonColors(void);
  336.     void SetShapeRGB(gxShape target, gxColorValue red, gxColorValue green, gxColorValue blue);
  337.     void SetInkRGB(gxInk target, gxColorValue red, gxColorValue green, gxColorValue blue);
  338.     void SetShapeHSV(gxShape target, gxColorValue hue, gxColorValue saturation, gxColorValue value);
  339.     void SetInkHSV(gxInk target, gxColorValue hue, gxColorValue saturation, gxColorValue value);
  340.     void SetShapeGray(gxShape target, gxColorValue gray);
  341.     void SetInkGray(gxInk target, gxColorValue gray);
  342.  
  343.     /* gxTransferMode library, gxColor library, text library */
  344.     void SetShapeCommonTransfer(gxShape target, commonTransferMode mode);
  345.     void SetShapeCommonColor(gxShape target, commonColor color);
  346.     void SetShapeCommonFace(gxShape target, commonFace face);
  347.  
  348.     void SetInkCommonTransfer(gxInk target, commonTransferMode mode);
  349.     void SetInkCommonColor(gxInk target, commonColor);
  350.     void SetStyleCommonFace(gxStyle target, commonFace);
  351.  
  352.     commonTransferMode GetInkCommonTransfer(gxInk source);
  353.     commonColor GetInkCommonColor(gxInk source);
  354.     commonFace GetStyleCommonFace(gxStyle source);
  355.  
  356.     commonTransferMode GetShapeCommonTransfer(gxShape source);
  357.     commonColor GetShapeCommonColor(gxShape source);
  358.     commonFace GetShapeCommonFace(gxShape source);
  359.  
  360.     gxColor *SetCommonColor(gxColor *target, commonColor color);
  361.     commonColor GetCommonColor(const gxColor *source);
  362.  
  363.     /* gxColor library */
  364.     gxColorSpace GetShapeColorSpace(gxShape target);
  365.     gxColorProfile GetShapeColorProfile(gxShape source);
  366.     gxColorSet GetShapeColorSet(gxShape source);
  367.     gxColorSpace GetInkColorSpace(gxInk target);
  368.     gxColorProfile GetInkColorProfile(gxInk source);
  369.     gxColorSet GetInkColorSet(gxInk source);
  370.  
  371.     void SetShapeColorSpace(gxShape target, gxColorSpace space);
  372.     void SetShapeColorProfile(gxShape target, gxColorProfile profile);
  373.     void SetShapeColorSet(gxShape target, gxColorSet set);
  374.     void SetInkColorSpace(gxInk target, gxColorSpace space);
  375.     void SetInkColorProfile(gxInk target, gxColorProfile profile);
  376.     void SetInkColorSet(gxInk target, gxColorSet set);
  377.  
  378.     gxColorSet GetViewDeviceColorSet(gxViewDevice source);
  379.     void SetViewDeviceColorSet(gxViewDevice target, gxColorSet set);
  380.     gxColorProfile GetViewDeviceColorProfile(gxViewDevice source);
  381.     void SetViewDeviceColorProfile(gxViewDevice target, gxColorProfile profile);
  382.  
  383.     long GetColorSpaceComponents(gxColorSpace space);
  384.  
  385.     /* gxTransferMode library */
  386.     void InitTransferMode(gxTransferMode *mode);
  387.     gxTransferMode *SetCommonTransfer(gxTransferMode *transferModeRecord, commonTransferMode mode, unsigned short opValue, const gxColor *opColor);
  388.     gxColor *TransmogrifyColor(gxColor *dstColor, const gxColor *srcColor, const gxTransferMode *);
  389.     void SetInkFastXorTransfer(gxInk inky, gxViewDevice destDevice, gxViewPort destViewPort, gxColor *background, gxColor *result);
  390.     void SetShapeFastXorTransfer(gxShape source, gxColor *background, gxColor *result);
  391.  
  392.     gxShape NewCString(const char *cString, const gxPoint *position);
  393.     gxShape NewPString(const char *pascalString, const gxPoint *position);
  394.     gxShape NewChar(const char theChar, const gxPoint *position);
  395.     void SetCString(gxShape target, const char *cString, const gxPoint *position);
  396.     void SetPString(gxShape target, const char *pascalString, const gxPoint *position);
  397.     void SetChar(gxShape target, const char theChar, const gxPoint *position);
  398.     void DrawCString(const char *cString, const gxPoint *position);
  399.     void DrawPString(const char *pascalString, const gxPoint *position);
  400.     void gDrawChar(const char theChar, const gxPoint *position);
  401.  
  402.     Fixed FixTextWidth(const unsigned char *string, short length);
  403.     Fixed FixCStringWidth(const char *string);
  404.     Fixed FixPStringWidth(const char *string);
  405.     Fixed FixCharWidth(char ch);
  406.     gxPoint *GetShapeAdvance(gxShape target, gxPoint *advance);
  407.  
  408.     void SetGlyphText(gxShape target, const unsigned char *text, long length);
  409.     void SetGlyphAdvance(gxShape target, const long advanceBits[]);
  410.     void SetGlyphStyles(gxShape target, const short styleRuns[], const gxStyle glyphStyles[]);
  411.  
  412.     long GetGlyphText(gxShape source, unsigned char *text);
  413.     long GetGlyphAdvance(gxShape source, long advanceBits[]);
  414.     long GetGlyphStyles(gxShape source, short styleRuns[], gxStyle glyphStyles[]);
  415.  
  416.     /* gxMapping library */
  417.     void PolyToPolyMap(const gxPolygon *source, const gxPolygon *dest, gxMapping *mapping);
  418.  
  419.     /* gxShape library */
  420.     void PaintRectangle(const gxRectangle *source, commonColor color);
  421.     void PaintRectangle2(const gxPoint *leftTop, const gxPoint *rightBottom, commonColor color);
  422.     void PaintRectangle4(long left, long top, long right, long bottom, commonColor color);
  423.  
  424.     /* picture library */
  425.     void AddToPicture(gxShape picture, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  426.     void InsertPictureItem(gxShape picture, long index, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  427.     gxShape GetPictureItem(gxShape picture, long index, gxShape *destShape, gxStyle *destStyle, gxInk *destInk, gxTransform *destTransform);
  428.     void SetPictureItem(gxShape picture, long index, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  429.  
  430.     /* user library */
  431.     void AddShapeUser(gxShape target, const void *data, long length, long type);
  432.     long GetShapeUser(gxShape source, void *data, long *length, long requestedType, long *foundType, long index);
  433.     void RemoveShapeUser(gxShape target, long type, long index);
  434.  
  435.     /* ramp library */
  436.     gxShape NewRamp(const gxColor *firstColor, const gxColor *lastColor, long steps, const gxRectangle *bounds);
  437.     void DrawRamp(const gxColor *firstColor, const gxColor *lastColor, long steps, const gxRectangle *bounds);
  438.     gxShape NewCommonRamp(commonColor firstColor, commonColor lastColor, long steps, const gxRectangle *bounds);
  439.     void DrawCommonRamp(commonColor firstColor, commonColor lastColor, long steps, const gxRectangle *bounds);
  440.  
  441.     /* spline library */
  442.     #define circleSlack ((fract)0x3504f334) /* if the points form a square, this slop will approximate a circle */
  443.     enum { openSpline, closedSpline };    /* passed as the closed parameter */
  444.     gxShape MirrorSpline(long count, gxPoint *points, fract slack, boolean closed);
  445.  
  446.     /* framing libarary */
  447.     void OutsetShape(gxShape source, Fixed distance);
  448.     void FrameShape(gxShape source, Fixed distance);
  449.  
  450.     #ifdef __cplusplus
  451.     }
  452.     #endif
  453. #endif
  454.